package com.juc.forkJoinPool.forkJoinPool16;

import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

public class Test1 {

	//isCompletedAbnormally() 判断任务是否出现任务
	//isCompletedNormally() 判断任务是否正常执行完毕
	//getException() 返回报错异常
	public static void main(String[] args) throws InterruptedException {
		MyRecursiveTask action1 = new MyRecursiveTask();
		ForkJoinPool pool = new ForkJoinPool();
		ForkJoinTask<Integer> task = pool.submit(action1);
		System.out.println(task.isCompletedAbnormally() + "  " + task.isCompletedNormally());		
		Thread.sleep(2000);
		System.out.println(task.isCompletedAbnormally() + "  " + task.isCompletedNormally());		
        System.out.println(task.getException());
	}
}
